﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"[]>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="save" content="history" />
    <title>ToEntity(T) Method (DataTable, T, Int32)</title>
    <link rel="stylesheet" type="text/css" href="../styles/lightweight.css" xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:ddue="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:msxsl="urn:schemas-microsoft-com:xslt" />
    <link rel="stylesheet" type="text/css" href="../styles/lw-code.css" xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:ddue="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:msxsl="urn:schemas-microsoft-com:xslt" />
    <script type="text/javascript" xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:ddue="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:msxsl="urn:schemas-microsoft-com:xslt" src="../scripts/languageSelector.js"> </script>
    <meta name="container" content="Database.Core" xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:ddue="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:msxsl="urn:schemas-microsoft-com:xslt" />
    <meta name="file" content="1064107142" xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:ddue="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:msxsl="urn:schemas-microsoft-com:xslt" />
    <meta name="guid" content="1064107142" xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:ddue="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:msxsl="urn:schemas-microsoft-com:xslt" />
    <xml xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:ddue="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
      <MSHelp:Attr Name="AssetID" Value="M:Database.Core.Extensions.ToEntity``1(DataTable,``0,System.Int32)" />
      <MSHelp:TOCTitle Title="ToEntity(T) Method (DataTable, T, Int32)" />
      <MSHelp:RLTitle Title="Extensions.ToEntity(T) Method (DataTable, T, Int32) (Database.Core)" />
      <MSHelp:Keyword Index="A" Term="M:Database.Core.Extensions.ToEntity``1(DataTable,``0,System.Int32)" />
      <MSHelp:Attr Name="APIType" Value="Managed" />
      <MSHelp:Attr Name="APILocation" Value="DatabaseCore.dll" />
      <MSHelp:Attr Name="APIName" Value="Database.Core.Extensions.ToEntity" />
      <MSHelp:Attr Name="DevLang" Value="CSharp" />
      <MSHelp:Attr Name="DevLang" Value="VB" />
      <MSHelp:Attr Name="Locale" Value="en-us" />
      <MSHelp:Attr Name="TopicType" Value="kbSyntax" />
      <MSHelp:Attr Name="TopicType" Value="apiref" />
      <MSHelp:Attr Name="Abstract" Value="Populates an existing entity from specified contained within the ." />
      <MSHelp:Attr Name="AssemblyVersion" Value="" />
    </xml>
  </head>
  <body>
    <div class="contentPlaceHolder" xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:ddue="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
      <div class="content">
        <div class="topicContainer">
          <div class="topic">
            <p class="majorTitle" />
            <h1 class="title">Extensions<span class="languageSpecificText"><span class="cs">.</span><span class="vb">.</span><span class="cpp">::</span><span class="nu">.</span><span class="fs">.</span></span>ToEntity<span class="languageSpecificText"><span class="cs">&lt;</span><span class="vb">(Of </span><span class="cpp">&lt;</span><span class="nu">(</span><span class="fs">&lt;'</span></span><span class="typeparameter">T</span><span class="languageSpecificText"><span class="cs">&gt;</span><span class="vb">)</span><span class="cpp">&gt;</span><span class="nu">)</span><span class="fs">&gt;</span></span> Method (DataTable, <span class="typeparameter">T</span>, Int32)</h1>
            <div id="mainSection">
              <div id="mainBody">
                <div class="summary">
   Populates an existing entity from specified <a href="http://msdn.microsoft.com/en-us/library/system.data.datarow.aspx" target="_blank">DataRow</a> contained within the <a href="http://msdn.microsoft.com/en-us/library/system.data.datatable.aspx" target="_blank">DataTable</a>.
   </div>
                <p />
    <b>Namespace:</b> 
   <a href="1377938331.htm">Database.Core</a><br />
    <b>Assembly:</b>
   <span sdata="assembly">DatabaseCore</span> (in DatabaseCore.dll)<div class="LW_CollapsibleArea_Container"><div class="LW_CollapsibleArea_TitleDiv"><h2 class="LW_CollapsibleArea_Title">Syntax</h2><div class="LW_CollapsibleArea_HrDiv"><hr class="LW_CollapsibleArea_Hr" /></div></div><a id="syntaxSection"><!----></a><div class="CodeSnippetContainer"><div class="CodeSnippetContainerTabs"><div class="CodeSnippetContainerTabLeft"><!----></div><div class="CodeSnippetContainerTabFirst CSharpTab" id="CSharpTabId" style="background:white;border-bottom-color:white"><a href="javascript:setActiveTab('CodeSnippetContainerCode','CSharpCode','CSharpTabId');" title="C#">C#</a></div><div class="CodeSnippetContainerTab VisualBasicTab" id="VisualBasicTabId"><a href="javascript:setActiveTab('CodeSnippetContainerCode','VisualBasicCode','VisualBasicTabId');" title="Visual Basic">VB</a></div><div class="CodeSnippetContainerTab ManagedCPlusPlusTab" id="ManagedCPlusPlusTabId"><a href="javascript:setActiveTab('CodeSnippetContainerCode','ManagedCPlusPlusCode','ManagedCPlusPlusTabId');" title="Visual C++">C++</a></div><div class="CodeSnippetContainerTabRight"><!----></div></div><div class="CodeSnippetContainerCodeCollection"><div class="CodeSnippetToolBar"><div class="CodeSnippetToolBarText" /></div><div class="CodeSnippetContainerCode CSharpCode"><pre xml:space="preserve" class="libCScode"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">ToEntity</span>&lt;T&gt;(
	<span class="keyword">this</span> <a href="http://msdn.microsoft.com/en-us/library/system.data.datatable.aspx" target="_blank">DataTable</a> <span class="parameter">dataTable</span>,
	T <span class="parameter">entity</span>,
	<a href="http://msdn.microsoft.com/en-us/library/system.int32.aspx" target="_blank">int</a> <span class="parameter">rowIndex</span>
)
</pre></div><div class="CodeSnippetContainerCode VisualBasicCode"><pre xml:space="preserve" class="libCScode">&lt;<a href="http://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.extensionattribute.aspx" target="_blank">ExtensionAttribute</a>&gt; _
<span class="keyword">Public</span> <span class="keyword">Shared</span> <span class="keyword">Sub</span> <span class="identifier">ToEntity</span>(<span class="keyword">Of</span> T) ( _
	<span class="parameter">dataTable</span> <span class="keyword">As</span> <a href="http://msdn.microsoft.com/en-us/library/system.data.datatable.aspx" target="_blank">DataTable</a>, _
	<span class="parameter">entity</span> <span class="keyword">As</span> T, _
	<span class="parameter">rowIndex</span> <span class="keyword">As</span> <a href="http://msdn.microsoft.com/en-us/library/system.int32.aspx" target="_blank">Integer</a> _
)</pre></div><div class="CodeSnippetContainerCode ManagedCPlusPlusCode"><pre xml:space="preserve" class="libCScode">[<a href="http://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.extensionattribute.aspx" target="_blank">ExtensionAttribute</a>]
<span class="keyword">public</span>:
<span class="keyword">generic</span>&lt;<span class="keyword">typename</span> T&gt;
<span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">ToEntity</span>(
	<a href="http://msdn.microsoft.com/en-us/library/system.data.datatable.aspx" target="_blank">DataTable</a>^ <span class="parameter">dataTable</span>, 
	T <span class="parameter">entity</span>, 
	<a href="http://msdn.microsoft.com/en-us/library/system.int32.aspx" target="_blank">int</a>^ <span class="parameter">rowIndex</span>
)</pre></div></div></div><h4 class="subHeading">Type Parameters</h4><dl><dt><span class="parameterItalic">T</span></dt><dd>Entity type</dd></dl><div id="parameters"><h4 class="subHeading">Parameters</h4><dl paramName="dataTable"><dt><span class="parameterItalic">dataTable</span></dt><dd>Type: <a href="http://msdn.microsoft.com/en-us/library/system.data.datatable.aspx" target="_blank">DataTable</a><br />The <a href="http://msdn.microsoft.com/en-us/library/system.data.datatable.aspx" target="_blank">DataTable</a>.</dd></dl><dl paramName="entity"><dt><span class="parameterItalic">entity</span></dt><dd>Type: <span class="selflink"><span class="typeparam">T</span></span><br />The entity.</dd></dl><dl paramName="rowIndex"><dt><span class="parameterItalic">rowIndex</span></dt><dd>Type: <a href="http://msdn.microsoft.com/en-us/library/system.int32.aspx" target="_blank">Int32</a><br />Index of the <a href="http://msdn.microsoft.com/en-us/library/system.data.datarow.aspx" target="_blank">DataRow</a>.</dd></dl></div></div><div class="LW_CollapsibleArea_Container"><div class="LW_CollapsibleArea_TitleDiv"><h2 class="LW_CollapsibleArea_Title">See Also</h2><div class="LW_CollapsibleArea_HrDiv"><hr class="LW_CollapsibleArea_Hr" /></div></div><a id="seeAlsoSection"><!----></a><div class="seeAlsoStyle"><a href="87163052.htm">Extensions Class</a></div><div class="seeAlsoStyle"><a href="761216784.htm">ToEntity Overload</a></div><div class="seeAlsoStyle"><a href="1377938331.htm">Database.Core Namespace</a></div></div></div>
            </div>
          </div>
        </div>
      </div>
      <div class="footer">
        <div id="footer" class="footerContainer">
          <div class="footerLogoContainer">
            <div style="margin-top:5px">
              <span class="customCopyrightFooter" />
            </div>
            <div style="margin-top:5px" class="copyrightFooter">Help File generated with GhostDoc</div>
            <div> </div>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>